#ifndef _LOGIN_GW_VERIFY_TASK_H_
#define _LOGIN_GW_VERIFY_TASK_H_

#include <qbtools/message/MessagePoster.h>

#include "qbprotocol/include/rdClientLocal.h"
#include "qbprotocol/include/ssCmnDefine.h"
#include "task.h"

namespace qb {
class ThreadWrapper;

// 登录到LoginServer进行验证的任务
class CLoginGwVerifyTask : public CTask {
 public:
  CLoginGwVerifyTask();
  ~CLoginGwVerifyTask();

 protected:
  virtual void StartImpl();
  virtual void TerminateImpl();
  virtual bool IsConnectTask() { return false; }
  virtual void OnNetData(char* pRecvData, int nDataLen);
  virtual void OnNetStatus(int32_t status) {}
  virtual int32_t GetTaskTimeout() { return LOGIN_VERIFY_TIMEOUT; }

  void makeLoginData(char* buf, int& buflen);
  void SendClientInfo();
  void WrapReq(qb::proto::Message&, SSRequestMsg*);

 private:
  xMessageInfo_t m_data;
  xMsgHeadAck_t m_HeadAck;

  char* m_zip;
  uint32_t m_ziplen;
};
}  // namespace qb

#endif
